//
//  DZNsstringUtil.m
//  DaoZiJinFu
//
//  Created by dzjf on 2017/4/21.
//  Copyright © 2017年 dzjf. All rights reserved.
//

#import "DZNsstringUtil.h"

@implementation DZNsstringUtil

+ (float)floatInto:(float)value {
   return floor((value)*100)/100;
}
+ (NSString *)stringSubToNumber:(NSString *)subString {
    if (subString == nil) {
        return @"";
    }
    int count = 0;
    long long int a = subString.longLongValue;
    while (a != 0)
    {
        count++;
        a /= 10;
    }
    NSMutableString *string = [NSMutableString stringWithString:subString];
    NSMutableString *newstring = [NSMutableString string];
    while (count > 3) {
        count -= 3;
        NSRange rang = NSMakeRange(string.length - 3, 3);
        NSString *str = [string substringWithRange:rang];
        [newstring insertString:str atIndex:0];
        [newstring insertString:@"," atIndex:0];
        [string deleteCharactersInRange:rang];
    }
    [newstring insertString:string atIndex:0];
    NSString *new = [NSString stringWithFormat:@"%@",newstring];
    return new;
}
@end
